\(\int \frac {(A+B \log (e (\frac {a+b x}{c+d x})^n))^2}{(c g+d g x)^3} \, dx\) [44]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 35, antiderivative size = 317 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=-\frac {B^2 d n^2 (a+b x)^2}{4 (b c-a d)^2 g^3 (c+d x)^2}-\frac {2 A b B n (a+b x)}{(b c-a d)^2 g^3 (c+d x)}+\frac {2 b B^2 n^2 (a+b x)}{(b c-a d)^2 g^3 (c+d x)}-\frac {2 b B^2 n (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(b c-a d)^2 g^3 (c+d x)}+\frac {B d n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 (b c-a d)^2 g^3 (c+d x)^2}-\frac {d (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (c+d x)^2}+\frac {b (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (c+d x)} \]

[Out]

-1/4*B^2*d*n^2*(b*x+a)^2/(-a*d+b*c)^2/g^3/(d*x+c)^2-2*A*b*B*n*(b*x+a)/(-a*d+b*c)^2/g^3/(d*x+c)+2*b*B^2*n^2*(b*
x+a)/(-a*d+b*c)^2/g^3/(d*x+c)-2*b*B^2*n*(b*x+a)*ln(e*((b*x+a)/(d*x+c))^n)/(-a*d+b*c)^2/g^3/(d*x+c)+1/2*B*d*n*(
b*x+a)^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/(-a*d+b*c)^2/g^3/(d*x+c)^2-1/2*d*(b*x+a)^2*(A+B*ln(e*((b*x+a)/(d*x+c)
)^n))^2/(-a*d+b*c)^2/g^3/(d*x+c)^2+b*(b*x+a)*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/(-a*d+b*c)^2/g^3/(d*x+c)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 317, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.171, Rules used = {2551, 2367, 2333, 2332, 2342, 2341} \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=\frac {B d n (a+b x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{2 g^3 (c+d x)^2 (b c-a d)^2}+\frac {b (a+b x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{g^3 (c+d x) (b c-a d)^2}-\frac {d (a+b x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{2 g^3 (c+d x)^2 (b c-a d)^2}-\frac {2 A b B n (a+b x)}{g^3 (c+d x) (b c-a d)^2}-\frac {2 b B^2 n (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{g^3 (c+d x) (b c-a d)^2}+\frac {2 b B^2 n^2 (a+b x)}{g^3 (c+d x) (b c-a d)^2}-\frac {B^2 d n^2 (a+b x)^2}{4 g^3 (c+d x)^2 (b c-a d)^2} \]

[In]

Int[(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2/(c*g + d*g*x)^3,x]

[Out]

-1/4*(B^2*d*n^2*(a + b*x)^2)/((b*c - a*d)^2*g^3*(c + d*x)^2) - (2*A*b*B*n*(a + b*x))/((b*c - a*d)^2*g^3*(c + d
*x)) + (2*b*B^2*n^2*(a + b*x))/((b*c - a*d)^2*g^3*(c + d*x)) - (2*b*B^2*n*(a + b*x)*Log[e*((a + b*x)/(c + d*x)
)^n])/((b*c - a*d)^2*g^3*(c + d*x)) + (B*d*n*(a + b*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]))/(2*(b*c - a*d
)^2*g^3*(c + d*x)^2) - (d*(a + b*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2)/(2*(b*c - a*d)^2*g^3*(c + d*x)
^2) + (b*(a + b*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2)/((b*c - a*d)^2*g^3*(c + d*x))

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2367

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = Expand
Integrand[(a + b*Log[c*x^n])^p, (d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n, p, q, r}
, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[r]))

Rule 2551

Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m
_.), x_Symbol] :> Dist[(b*c - a*d)^(m + 1)*(g/d)^m, Subst[Int[(A + B*Log[e*x^n])^p/(b - d*x)^(m + 2), x], x, (
a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[m, p] &&
 EqQ[d*f - c*g, 0] && (GtQ[p, 0] || LtQ[m, -1])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int (b-d x) \left (A+B \log \left (e x^n\right )\right )^2 \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = \frac {\text {Subst}\left (\int \left (b \left (A+B \log \left (e x^n\right )\right )^2-d x \left (A+B \log \left (e x^n\right )\right )^2\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = \frac {b \text {Subst}\left (\int \left (A+B \log \left (e x^n\right )\right )^2 \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3}-\frac {d \text {Subst}\left (\int x \left (A+B \log \left (e x^n\right )\right )^2 \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = -\frac {d (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (c+d x)^2}+\frac {b (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (c+d x)}-\frac {(2 b B n) \text {Subst}\left (\int \left (A+B \log \left (e x^n\right )\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3}+\frac {(B d n) \text {Subst}\left (\int x \left (A+B \log \left (e x^n\right )\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = -\frac {B^2 d n^2 (a+b x)^2}{4 (b c-a d)^2 g^3 (c+d x)^2}-\frac {2 A b B n (a+b x)}{(b c-a d)^2 g^3 (c+d x)}+\frac {B d n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 (b c-a d)^2 g^3 (c+d x)^2}-\frac {d (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (c+d x)^2}+\frac {b (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (c+d x)}-\frac {\left (2 b B^2 n\right ) \text {Subst}\left (\int \log \left (e x^n\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = -\frac {B^2 d n^2 (a+b x)^2}{4 (b c-a d)^2 g^3 (c+d x)^2}-\frac {2 A b B n (a+b x)}{(b c-a d)^2 g^3 (c+d x)}+\frac {2 b B^2 n^2 (a+b x)}{(b c-a d)^2 g^3 (c+d x)}-\frac {2 b B^2 n (a+b x) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(b c-a d)^2 g^3 (c+d x)}+\frac {B d n (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 (b c-a d)^2 g^3 (c+d x)^2}-\frac {d (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (c+d x)^2}+\frac {b (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (c+d x)} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.

Time = 0.26 (sec) , antiderivative size = 464, normalized size of antiderivative = 1.46 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=\frac {-2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2+\frac {B n \left (2 (b c-a d)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+4 b (b c-a d) (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+4 b^2 (c+d x)^2 \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-4 b^2 (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (c+d x)-4 b B n (c+d x) (b c-a d+b (c+d x) \log (a+b x)-b (c+d x) \log (c+d x))-B n \left ((b c-a d)^2+2 b (b c-a d) (c+d x)+2 b^2 (c+d x)^2 \log (a+b x)-2 b^2 (c+d x)^2 \log (c+d x)\right )-2 b^2 B n (c+d x)^2 \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )+2 b^2 B n (c+d x)^2 \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )\right )}{(b c-a d)^2}}{4 d g^3 (c+d x)^2} \]

[In]

Integrate[(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2/(c*g + d*g*x)^3,x]

[Out]

(-2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2 + (B*n*(2*(b*c - a*d)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]) +
4*b*(b*c - a*d)*(c + d*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n]) + 4*b^2*(c + d*x)^2*Log[a + b*x]*(A + B*Log[e
*((a + b*x)/(c + d*x))^n]) - 4*b^2*(c + d*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])*Log[c + d*x] - 4*b*B*n*(
c + d*x)*(b*c - a*d + b*(c + d*x)*Log[a + b*x] - b*(c + d*x)*Log[c + d*x]) - B*n*((b*c - a*d)^2 + 2*b*(b*c - a
*d)*(c + d*x) + 2*b^2*(c + d*x)^2*Log[a + b*x] - 2*b^2*(c + d*x)^2*Log[c + d*x]) - 2*b^2*B*n*(c + d*x)^2*(Log[
a + b*x]*(Log[a + b*x] - 2*Log[(b*(c + d*x))/(b*c - a*d)]) - 2*PolyLog[2, (d*(a + b*x))/(-(b*c) + a*d)]) + 2*b
^2*B*n*(c + d*x)^2*((2*Log[(d*(a + b*x))/(-(b*c) + a*d)] - Log[c + d*x])*Log[c + d*x] + 2*PolyLog[2, (b*(c + d
*x))/(b*c - a*d)])))/(b*c - a*d)^2)/(4*d*g^3*(c + d*x)^2)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(671\) vs. \(2(311)=622\).

Time = 7.41 (sec) , antiderivative size = 672, normalized size of antiderivative = 2.12

method result size
parallelrisch \(-\frac {-8 B^{2} a \,b^{2} c \,d^{4} n^{3}-2 A B \,a^{2} b \,d^{5} n^{2}-6 A B \,b^{3} c^{2} d^{3} n^{2}-4 A^{2} a \,b^{2} c \,d^{4} n +2 A^{2} b^{3} c^{2} d^{3} n +2 A^{2} a^{2} b \,d^{5} n +7 B^{2} b^{3} c^{2} d^{3} n^{3}+B^{2} a^{2} b \,d^{5} n^{3}-4 A B \,x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} d^{5} n -4 B^{2} x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} b^{3} c \,d^{4} n +4 B^{2} x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{2} d^{5} n^{2}+8 B^{2} x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} c \,d^{4} n^{2}+4 A B x a \,b^{2} d^{5} n^{2}-4 A B x \,b^{3} c \,d^{4} n^{2}-4 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} a \,b^{2} c \,d^{4} n +8 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{2} c \,d^{4} n^{2}+4 A B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} b \,d^{5} n +8 A B a \,b^{2} c \,d^{4} n^{2}-8 A B x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} c \,d^{4} n -8 A B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{2} c \,d^{4} n -2 B^{2} x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} b^{3} d^{5} n +6 B^{2} x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} d^{5} n^{2}-6 B^{2} x a \,b^{2} d^{5} n^{3}+6 B^{2} x \,b^{3} c \,d^{4} n^{3}+2 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} a^{2} b \,d^{5} n -2 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} b \,d^{5} n^{2}}{4 g^{3} \left (d x +c \right )^{2} \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) b \,d^{4} n}\) \(672\)

[In]

int((A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/(d*g*x+c*g)^3,x,method=_RETURNVERBOSE)

[Out]

-1/4*(-8*B^2*a*b^2*c*d^4*n^3-2*A*B*a^2*b*d^5*n^2-6*A*B*b^3*c^2*d^3*n^2-4*A^2*a*b^2*c*d^4*n+2*A^2*b^3*c^2*d^3*n
+2*A^2*a^2*b*d^5*n+7*B^2*b^3*c^2*d^3*n^3+B^2*a^2*b*d^5*n^3-4*A*B*x^2*ln(e*((b*x+a)/(d*x+c))^n)*b^3*d^5*n-4*B^2
*x*ln(e*((b*x+a)/(d*x+c))^n)^2*b^3*c*d^4*n+4*B^2*x*ln(e*((b*x+a)/(d*x+c))^n)*a*b^2*d^5*n^2+8*B^2*x*ln(e*((b*x+
a)/(d*x+c))^n)*b^3*c*d^4*n^2+4*A*B*x*a*b^2*d^5*n^2-4*A*B*x*b^3*c*d^4*n^2-4*B^2*ln(e*((b*x+a)/(d*x+c))^n)^2*a*b
^2*c*d^4*n+8*B^2*ln(e*((b*x+a)/(d*x+c))^n)*a*b^2*c*d^4*n^2+4*A*B*ln(e*((b*x+a)/(d*x+c))^n)*a^2*b*d^5*n+8*A*B*a
*b^2*c*d^4*n^2-8*A*B*x*ln(e*((b*x+a)/(d*x+c))^n)*b^3*c*d^4*n-8*A*B*ln(e*((b*x+a)/(d*x+c))^n)*a*b^2*c*d^4*n-2*B
^2*x^2*ln(e*((b*x+a)/(d*x+c))^n)^2*b^3*d^5*n+6*B^2*x^2*ln(e*((b*x+a)/(d*x+c))^n)*b^3*d^5*n^2-6*B^2*x*a*b^2*d^5
*n^3+6*B^2*x*b^3*c*d^4*n^3+2*B^2*ln(e*((b*x+a)/(d*x+c))^n)^2*a^2*b*d^5*n-2*B^2*ln(e*((b*x+a)/(d*x+c))^n)*a^2*b
*d^5*n^2)/g^3/(d*x+c)^2/(a^2*d^2-2*a*b*c*d+b^2*c^2)/b/d^4/n

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 654 vs. \(2 (311) = 622\).

Time = 0.29 (sec) , antiderivative size = 654, normalized size of antiderivative = 2.06 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=-\frac {2 \, A^{2} b^{2} c^{2} - 4 \, A^{2} a b c d + 2 \, A^{2} a^{2} d^{2} + {\left (7 \, B^{2} b^{2} c^{2} - 8 \, B^{2} a b c d + B^{2} a^{2} d^{2}\right )} n^{2} + 2 \, {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d + B^{2} a^{2} d^{2}\right )} \log \left (e\right )^{2} - 2 \, {\left (B^{2} b^{2} d^{2} n^{2} x^{2} + 2 \, B^{2} b^{2} c d n^{2} x + {\left (2 \, B^{2} a b c d - B^{2} a^{2} d^{2}\right )} n^{2}\right )} \log \left (\frac {b x + a}{d x + c}\right )^{2} - 2 \, {\left (3 \, A B b^{2} c^{2} - 4 \, A B a b c d + A B a^{2} d^{2}\right )} n + 2 \, {\left (3 \, {\left (B^{2} b^{2} c d - B^{2} a b d^{2}\right )} n^{2} - 2 \, {\left (A B b^{2} c d - A B a b d^{2}\right )} n\right )} x + 2 \, {\left (2 \, A B b^{2} c^{2} - 4 \, A B a b c d + 2 \, A B a^{2} d^{2} - 2 \, {\left (B^{2} b^{2} c d - B^{2} a b d^{2}\right )} n x - {\left (3 \, B^{2} b^{2} c^{2} - 4 \, B^{2} a b c d + B^{2} a^{2} d^{2}\right )} n - 2 \, {\left (B^{2} b^{2} d^{2} n x^{2} + 2 \, B^{2} b^{2} c d n x + {\left (2 \, B^{2} a b c d - B^{2} a^{2} d^{2}\right )} n\right )} \log \left (\frac {b x + a}{d x + c}\right )\right )} \log \left (e\right ) + 2 \, {\left ({\left (4 \, B^{2} a b c d - B^{2} a^{2} d^{2}\right )} n^{2} + {\left (3 \, B^{2} b^{2} d^{2} n^{2} - 2 \, A B b^{2} d^{2} n\right )} x^{2} - 2 \, {\left (2 \, A B a b c d - A B a^{2} d^{2}\right )} n - 2 \, {\left (2 \, A B b^{2} c d n - {\left (2 \, B^{2} b^{2} c d + B^{2} a b d^{2}\right )} n^{2}\right )} x\right )} \log \left (\frac {b x + a}{d x + c}\right )}{4 \, {\left ({\left (b^{2} c^{2} d^{3} - 2 \, a b c d^{4} + a^{2} d^{5}\right )} g^{3} x^{2} + 2 \, {\left (b^{2} c^{3} d^{2} - 2 \, a b c^{2} d^{3} + a^{2} c d^{4}\right )} g^{3} x + {\left (b^{2} c^{4} d - 2 \, a b c^{3} d^{2} + a^{2} c^{2} d^{3}\right )} g^{3}\right )}} \]

[In]

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))^2/(d*g*x+c*g)^3,x, algorithm="fricas")

[Out]

-1/4*(2*A^2*b^2*c^2 - 4*A^2*a*b*c*d + 2*A^2*a^2*d^2 + (7*B^2*b^2*c^2 - 8*B^2*a*b*c*d + B^2*a^2*d^2)*n^2 + 2*(B
^2*b^2*c^2 - 2*B^2*a*b*c*d + B^2*a^2*d^2)*log(e)^2 - 2*(B^2*b^2*d^2*n^2*x^2 + 2*B^2*b^2*c*d*n^2*x + (2*B^2*a*b
*c*d - B^2*a^2*d^2)*n^2)*log((b*x + a)/(d*x + c))^2 - 2*(3*A*B*b^2*c^2 - 4*A*B*a*b*c*d + A*B*a^2*d^2)*n + 2*(3
*(B^2*b^2*c*d - B^2*a*b*d^2)*n^2 - 2*(A*B*b^2*c*d - A*B*a*b*d^2)*n)*x + 2*(2*A*B*b^2*c^2 - 4*A*B*a*b*c*d + 2*A
*B*a^2*d^2 - 2*(B^2*b^2*c*d - B^2*a*b*d^2)*n*x - (3*B^2*b^2*c^2 - 4*B^2*a*b*c*d + B^2*a^2*d^2)*n - 2*(B^2*b^2*
d^2*n*x^2 + 2*B^2*b^2*c*d*n*x + (2*B^2*a*b*c*d - B^2*a^2*d^2)*n)*log((b*x + a)/(d*x + c)))*log(e) + 2*((4*B^2*
a*b*c*d - B^2*a^2*d^2)*n^2 + (3*B^2*b^2*d^2*n^2 - 2*A*B*b^2*d^2*n)*x^2 - 2*(2*A*B*a*b*c*d - A*B*a^2*d^2)*n - 2
*(2*A*B*b^2*c*d*n - (2*B^2*b^2*c*d + B^2*a*b*d^2)*n^2)*x)*log((b*x + a)/(d*x + c)))/((b^2*c^2*d^3 - 2*a*b*c*d^
4 + a^2*d^5)*g^3*x^2 + 2*(b^2*c^3*d^2 - 2*a*b*c^2*d^3 + a^2*c*d^4)*g^3*x + (b^2*c^4*d - 2*a*b*c^3*d^2 + a^2*c^
2*d^3)*g^3)

Sympy [F]

\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=\frac {\int \frac {A^{2}}{c^{3} + 3 c^{2} d x + 3 c d^{2} x^{2} + d^{3} x^{3}}\, dx + \int \frac {B^{2} \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )}^{2}}{c^{3} + 3 c^{2} d x + 3 c d^{2} x^{2} + d^{3} x^{3}}\, dx + \int \frac {2 A B \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )}}{c^{3} + 3 c^{2} d x + 3 c d^{2} x^{2} + d^{3} x^{3}}\, dx}{g^{3}} \]

[In]

integrate((A+B*ln(e*((b*x+a)/(d*x+c))**n))**2/(d*g*x+c*g)**3,x)

[Out]

(Integral(A**2/(c**3 + 3*c**2*d*x + 3*c*d**2*x**2 + d**3*x**3), x) + Integral(B**2*log(e*(a/(c + d*x) + b*x/(c
 + d*x))**n)**2/(c**3 + 3*c**2*d*x + 3*c*d**2*x**2 + d**3*x**3), x) + Integral(2*A*B*log(e*(a/(c + d*x) + b*x/
(c + d*x))**n)/(c**3 + 3*c**2*d*x + 3*c*d**2*x**2 + d**3*x**3), x))/g**3

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 861 vs. \(2 (311) = 622\).

Time = 0.24 (sec) , antiderivative size = 861, normalized size of antiderivative = 2.72 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=\frac {1}{2} \, A B n {\left (\frac {2 \, b d x + 3 \, b c - a d}{{\left (b c d^{3} - a d^{4}\right )} g^{3} x^{2} + 2 \, {\left (b c^{2} d^{2} - a c d^{3}\right )} g^{3} x + {\left (b c^{3} d - a c^{2} d^{2}\right )} g^{3}} + \frac {2 \, b^{2} \log \left (b x + a\right )}{{\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} g^{3}} - \frac {2 \, b^{2} \log \left (d x + c\right )}{{\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} g^{3}}\right )} + \frac {1}{4} \, {\left (2 \, n {\left (\frac {2 \, b d x + 3 \, b c - a d}{{\left (b c d^{3} - a d^{4}\right )} g^{3} x^{2} + 2 \, {\left (b c^{2} d^{2} - a c d^{3}\right )} g^{3} x + {\left (b c^{3} d - a c^{2} d^{2}\right )} g^{3}} + \frac {2 \, b^{2} \log \left (b x + a\right )}{{\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} g^{3}} - \frac {2 \, b^{2} \log \left (d x + c\right )}{{\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} g^{3}}\right )} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) - \frac {{\left (7 \, b^{2} c^{2} - 8 \, a b c d + a^{2} d^{2} + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (b x + a\right )^{2} + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (d x + c\right )^{2} + 6 \, {\left (b^{2} c d - a b d^{2}\right )} x + 6 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (b x + a\right ) - 2 \, {\left (3 \, b^{2} d^{2} x^{2} + 6 \, b^{2} c d x + 3 \, b^{2} c^{2} + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )\right )} n^{2}}{b^{2} c^{4} d g^{3} - 2 \, a b c^{3} d^{2} g^{3} + a^{2} c^{2} d^{3} g^{3} + {\left (b^{2} c^{2} d^{3} g^{3} - 2 \, a b c d^{4} g^{3} + a^{2} d^{5} g^{3}\right )} x^{2} + 2 \, {\left (b^{2} c^{3} d^{2} g^{3} - 2 \, a b c^{2} d^{3} g^{3} + a^{2} c d^{4} g^{3}\right )} x}\right )} B^{2} - \frac {B^{2} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )^{2}}{2 \, {\left (d^{3} g^{3} x^{2} + 2 \, c d^{2} g^{3} x + c^{2} d g^{3}\right )}} - \frac {A B \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )}{d^{3} g^{3} x^{2} + 2 \, c d^{2} g^{3} x + c^{2} d g^{3}} - \frac {A^{2}}{2 \, {\left (d^{3} g^{3} x^{2} + 2 \, c d^{2} g^{3} x + c^{2} d g^{3}\right )}} \]

[In]

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))^2/(d*g*x+c*g)^3,x, algorithm="maxima")

[Out]

1/2*A*B*n*((2*b*d*x + 3*b*c - a*d)/((b*c*d^3 - a*d^4)*g^3*x^2 + 2*(b*c^2*d^2 - a*c*d^3)*g^3*x + (b*c^3*d - a*c
^2*d^2)*g^3) + 2*b^2*log(b*x + a)/((b^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*g^3) - 2*b^2*log(d*x + c)/((b^2*c^2*d -
 2*a*b*c*d^2 + a^2*d^3)*g^3)) + 1/4*(2*n*((2*b*d*x + 3*b*c - a*d)/((b*c*d^3 - a*d^4)*g^3*x^2 + 2*(b*c^2*d^2 -
a*c*d^3)*g^3*x + (b*c^3*d - a*c^2*d^2)*g^3) + 2*b^2*log(b*x + a)/((b^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*g^3) - 2
*b^2*log(d*x + c)/((b^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*g^3))*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) - (7*b^2*c
^2 - 8*a*b*c*d + a^2*d^2 + 2*(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*log(b*x + a)^2 + 2*(b^2*d^2*x^2 + 2*b^2*c*d
*x + b^2*c^2)*log(d*x + c)^2 + 6*(b^2*c*d - a*b*d^2)*x + 6*(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*log(b*x + a)
- 2*(3*b^2*d^2*x^2 + 6*b^2*c*d*x + 3*b^2*c^2 + 2*(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*log(b*x + a))*log(d*x +
 c))*n^2/(b^2*c^4*d*g^3 - 2*a*b*c^3*d^2*g^3 + a^2*c^2*d^3*g^3 + (b^2*c^2*d^3*g^3 - 2*a*b*c*d^4*g^3 + a^2*d^5*g
^3)*x^2 + 2*(b^2*c^3*d^2*g^3 - 2*a*b*c^2*d^3*g^3 + a^2*c*d^4*g^3)*x))*B^2 - 1/2*B^2*log(e*(b*x/(d*x + c) + a/(
d*x + c))^n)^2/(d^3*g^3*x^2 + 2*c*d^2*g^3*x + c^2*d*g^3) - A*B*log(e*(b*x/(d*x + c) + a/(d*x + c))^n)/(d^3*g^3
*x^2 + 2*c*d^2*g^3*x + c^2*d*g^3) - 1/2*A^2/(d^3*g^3*x^2 + 2*c*d^2*g^3*x + c^2*d*g^3)

Giac [A] (verification not implemented)

none

Time = 0.97 (sec) , antiderivative size = 407, normalized size of antiderivative = 1.28 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=\frac {1}{4} \, {\left (2 \, {\left (\frac {2 \, {\left (b x + a\right )} B^{2} b n^{2}}{{\left (b c g^{3} - a d g^{3}\right )} {\left (d x + c\right )}} - \frac {{\left (b x + a\right )}^{2} B^{2} d n^{2}}{{\left (b c g^{3} - a d g^{3}\right )} {\left (d x + c\right )}^{2}}\right )} \log \left (\frac {b x + a}{d x + c}\right )^{2} + 2 \, {\left (\frac {{\left (B^{2} d n^{2} - 2 \, B^{2} d n \log \left (e\right ) - 2 \, A B d n\right )} {\left (b x + a\right )}^{2}}{{\left (b c g^{3} - a d g^{3}\right )} {\left (d x + c\right )}^{2}} - \frac {4 \, {\left (B^{2} b n^{2} - B^{2} b n \log \left (e\right ) - A B b n\right )} {\left (b x + a\right )}}{{\left (b c g^{3} - a d g^{3}\right )} {\left (d x + c\right )}}\right )} \log \left (\frac {b x + a}{d x + c}\right ) - \frac {{\left (B^{2} d n^{2} - 2 \, B^{2} d n \log \left (e\right ) + 2 \, B^{2} d \log \left (e\right )^{2} - 2 \, A B d n + 4 \, A B d \log \left (e\right ) + 2 \, A^{2} d\right )} {\left (b x + a\right )}^{2}}{{\left (b c g^{3} - a d g^{3}\right )} {\left (d x + c\right )}^{2}} + \frac {4 \, {\left (2 \, B^{2} b n^{2} - 2 \, B^{2} b n \log \left (e\right ) + B^{2} b \log \left (e\right )^{2} - 2 \, A B b n + 2 \, A B b \log \left (e\right ) + A^{2} b\right )} {\left (b x + a\right )}}{{\left (b c g^{3} - a d g^{3}\right )} {\left (d x + c\right )}}\right )} {\left (\frac {b c}{{\left (b c - a d\right )}^{2}} - \frac {a d}{{\left (b c - a d\right )}^{2}}\right )} \]

[In]

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))^2/(d*g*x+c*g)^3,x, algorithm="giac")

[Out]

1/4*(2*(2*(b*x + a)*B^2*b*n^2/((b*c*g^3 - a*d*g^3)*(d*x + c)) - (b*x + a)^2*B^2*d*n^2/((b*c*g^3 - a*d*g^3)*(d*
x + c)^2))*log((b*x + a)/(d*x + c))^2 + 2*((B^2*d*n^2 - 2*B^2*d*n*log(e) - 2*A*B*d*n)*(b*x + a)^2/((b*c*g^3 -
a*d*g^3)*(d*x + c)^2) - 4*(B^2*b*n^2 - B^2*b*n*log(e) - A*B*b*n)*(b*x + a)/((b*c*g^3 - a*d*g^3)*(d*x + c)))*lo
g((b*x + a)/(d*x + c)) - (B^2*d*n^2 - 2*B^2*d*n*log(e) + 2*B^2*d*log(e)^2 - 2*A*B*d*n + 4*A*B*d*log(e) + 2*A^2
*d)*(b*x + a)^2/((b*c*g^3 - a*d*g^3)*(d*x + c)^2) + 4*(2*B^2*b*n^2 - 2*B^2*b*n*log(e) + B^2*b*log(e)^2 - 2*A*B
*b*n + 2*A*B*b*log(e) + A^2*b)*(b*x + a)/((b*c*g^3 - a*d*g^3)*(d*x + c)))*(b*c/(b*c - a*d)^2 - a*d/(b*c - a*d)
^2)

Mupad [B] (verification not implemented)

Time = 2.18 (sec) , antiderivative size = 505, normalized size of antiderivative = 1.59 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^3} \, dx=-{\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )}^2\,\left (\frac {B^2}{2\,d\,\left (c^2\,g^3+2\,c\,d\,g^3\,x+d^2\,g^3\,x^2\right )}-\frac {B^2\,b^2}{2\,d\,g^3\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )-\frac {\frac {2\,A^2\,a\,d-2\,A^2\,b\,c+B^2\,a\,d\,n^2-7\,B^2\,b\,c\,n^2-2\,A\,B\,a\,d\,n+6\,A\,B\,b\,c\,n}{2\,\left (a\,d-b\,c\right )}-\frac {b\,x\,\left (3\,B^2\,d\,n^2-2\,A\,B\,d\,n\right )}{a\,d-b\,c}}{2\,c^2\,d\,g^3+4\,c\,d^2\,g^3\,x+2\,d^3\,g^3\,x^2}-\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (\frac {A\,B}{c^2\,d\,g^3+2\,c\,d^2\,g^3\,x+d^3\,g^3\,x^2}+\frac {B^2\,b^2\,\left (\frac {d^2\,g^3\,n\,x\,\left (a\,d-b\,c\right )}{b}-\frac {d\,g^3\,n\,\left (a\,d-b\,c\right )\,\left (a\,d-2\,b\,c\right )}{2\,b^2}+\frac {c\,d\,g^3\,n\,\left (a\,d-b\,c\right )}{2\,b}\right )}{d\,g^3\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )\,\left (c^2\,d\,g^3+2\,c\,d^2\,g^3\,x+d^3\,g^3\,x^2\right )}\right )-\frac {B\,b^2\,n\,\mathrm {atan}\left (\frac {\left (2\,b\,d\,x+\frac {2\,a^2\,d^3\,g^3-2\,b^2\,c^2\,d\,g^3}{2\,d\,g^3\,\left (a\,d-b\,c\right )}\right )\,1{}\mathrm {i}}{a\,d-b\,c}\right )\,\left (2\,A-3\,B\,n\right )\,1{}\mathrm {i}}{d\,g^3\,{\left (a\,d-b\,c\right )}^2} \]

[In]

int((A + B*log(e*((a + b*x)/(c + d*x))^n))^2/(c*g + d*g*x)^3,x)

[Out]

- log(e*((a + b*x)/(c + d*x))^n)^2*(B^2/(2*d*(c^2*g^3 + d^2*g^3*x^2 + 2*c*d*g^3*x)) - (B^2*b^2)/(2*d*g^3*(a^2*
d^2 + b^2*c^2 - 2*a*b*c*d))) - ((2*A^2*a*d - 2*A^2*b*c + B^2*a*d*n^2 - 7*B^2*b*c*n^2 - 2*A*B*a*d*n + 6*A*B*b*c
*n)/(2*(a*d - b*c)) - (b*x*(3*B^2*d*n^2 - 2*A*B*d*n))/(a*d - b*c))/(2*c^2*d*g^3 + 2*d^3*g^3*x^2 + 4*c*d^2*g^3*
x) - log(e*((a + b*x)/(c + d*x))^n)*((A*B)/(c^2*d*g^3 + d^3*g^3*x^2 + 2*c*d^2*g^3*x) + (B^2*b^2*((d^2*g^3*n*x*
(a*d - b*c))/b - (d*g^3*n*(a*d - b*c)*(a*d - 2*b*c))/(2*b^2) + (c*d*g^3*n*(a*d - b*c))/(2*b)))/(d*g^3*(a^2*d^2
 + b^2*c^2 - 2*a*b*c*d)*(c^2*d*g^3 + d^3*g^3*x^2 + 2*c*d^2*g^3*x))) - (B*b^2*n*atan(((2*b*d*x + (2*a^2*d^3*g^3
 - 2*b^2*c^2*d*g^3)/(2*d*g^3*(a*d - b*c)))*1i)/(a*d - b*c))*(2*A - 3*B*n)*1i)/(d*g^3*(a*d - b*c)^2)